<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('优惠券类型')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[type]', ['discount'=>__('折扣'), 'reward'=>__('满减'), 'goods'=>__('赠品')], $row['type'])}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Coupon_name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-coupon_name" data-rule="required" class="form-control" name="row[coupon_name]" type="text" value="{$row.coupon_name|htmlentities}">
        </div>
    </div>
    <div class="form-group reward">
        <label class="control-label col-xs-12 col-sm-2">{:__('Money')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-money" data-rule="required" min="0" class="form-control" step="0.01" name="row[money]" type="number" value="{$row.money|htmlentities}">
        </div>
    </div>
    <div class="form-group discount">
        <label class="control-label col-xs-12 col-sm-2">{:__('优惠券折扣')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-discount" data-rule="required" min="0" class="form-control" step="0.01" name="row[discount]" type="number" value="{$row.discount|htmlentities}">
        </div>
    </div>
    <div class="form-group discount">
        <label class="control-label col-xs-12 col-sm-2">{:__('最多优惠')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-discount_limit" data-rule="required" min="0" class="form-control" step="0.01" name="row[discount_limit]" type="number" value="{$row.discount_limit|htmlentities}">
        </div>
    </div>
    <div class="form-group goods">
        <label class="control-label col-xs-12 col-sm-2">{:__('选择商品')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-goods_id" data-rule="required" data-source="shop/goods/index" data-field="title" class="form-control selectpage" name="row[goods_id]" type="text" value="{$row.goods_id|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Count')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-count" data-rule="required" min="0" class="form-control" name="row[count]" type="number" value="{$row.count|htmlentities}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('At_least')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-at_least" data-rule="required" min="0" class="form-control" step="0.01" name="row[at_least]" type="number" value="{$row.at_least|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('有效期类型')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[validity_type]', ['0'=>__('固定时间'), '1'=>__('领取之日起')], $row['validity_type'])}
        </div>
    </div>

    <div class="form-group" id="end_time">
        <label for="c-end_time" class="control-label col-xs-12 col-sm-2">{:__('有效日期结束时间')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-end_time" {if $row['validity_type']==0}data-rule="required"{/if} class="form-control datetimepicker" name="row[end_time]" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" type="text"  value="{$row['end_time']|datetime}">
        </div>
    </div>


    <div class="form-group"  id="fixed_term">
        <label for="c-fixed_term" class="control-label col-xs-12 col-sm-2">{:__('领取之日起')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-fixed_term" {if $row['validity_type']==1}data-rule="required"{/if}  class="form-control" name="row[fixed_term]" type="number" data-tip="天" value="{$row['fixed_term']}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Max_fetch')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-max_fetch" data-rule="required" min="0" class="form-control" name="row[max_fetch]" type="number" value="{$row.max_fetch|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
        </div>
    </div>
    <!--<div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')], $row['status'])}
        </div>
    </div>-->
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
